package cn.edu.springboot03.controller;

import cn.edu.springboot03.entity.DataBase;
import cn.edu.springboot03.entity.Student;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Mr.ma
 * @since 2022/11/15 16:48
 **/
@RestController
public class HelloController {
    @Resource
    private DataBase dataBase;
    @Value("${server.port}")
    private String port;
    @RequestMapping("/student")
    public Student getStudent(){
        return new Student("张三","11","郑州");
    }
    @RequestMapping("/dataBase")
    public DataBase getDataBase(){
        return dataBase;
    }
    @RequestMapping("/port")
    public String getPort(){
        return "当前服务器端口号为：" + port;
    }
}
